<?php

namespace app\command;

use app\demo\controller\MqConsumer;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\Output;

class Consumer extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('consumer')
            ->addArgument('no', Argument::REQUIRED, "queue number")
            ->setDescription('the consumer command');
        // 设置参数
        // 指令配置
    }

    protected function execute(Input $input, Output $output)
    {
        $no = $input->getArgument('no');
    	// 指令输出
//    	$output->writeln($no?$no:1);
        $consumer = new MqConsumer();
        $consumer->start($no);//调用消费者
    }
}
